package com.example.myspringai.constant;

public enum GuardEnum {
    //S1: Violent Crimes
    //S2: Non-Violent Crimes
    //S3: Sex-Related Crimes
    //S4: Child Sexual Exploitation
    //S5: Defamation
    //S6: Specialized Advice
    //S7: Privacy
    //S8: Intellectual Property
    //S9: Indiscriminate Weapons
    //S10: Hate
    //S11: Suicide & Self-Harm
    //S12: Sexual Content
    //S13: Elections
    //S14: Code Interpreter Abuse
    S1("S1","Violent Crimes"),
    S2("S2","Non-Violent Crimes"),
    S3("S3","Sex-Related Crimes"),
    S4("S4","Child Sexual Exploitation"),
    S5("S5","Defamation"),
    S6("S6","Specialized Advice"),
    S7("S7","Privacy"),
    S8("S8","Intellectual Property"),
    S9("S9","Indiscriminate Weapons"),
    S10("S10","Hate"),
    S11("S11","Suicide & Self-Harm"),
    S12("S12","Violating Content"),
    S13("S13","Elections"),
    S14("S14","Code Interpreter Abuse");

    String code;

    String name;

    GuardEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(String code) {
        for (GuardEnum guardEnum : GuardEnum.values()) {
            if (code.contains(guardEnum.code)) {
                return guardEnum.name;
            }
        }
        return code;
    }
}
